Announcement

Collapse
No announcement yet.

OSL – strengths and limitations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by sharktacos View Post
    how about gettextureinfo "exists" ?
    It is not implemented at the moment, but even if it has been it will return true all the time for this case.
    In the future you'll be able to connect textures directly to the color inputs, so this won't be a problem.

    I'm not sure if it is possible to modify the current version of the parameter translator. I'll take a look and I'll tell you later.

    About the slider issue - it is in the TODO, so we'll fix it at some point.
    V-Ray developer

    Comment


    • #17
      Originally posted by t.petrov View Post
      It is not implemented at the moment, but even if it has been it will return true all the time for this case.
      In the future you'll be able to connect textures directly to the color inputs, so this won't be a problem.
      About the slider issue - it is in the TODO, so we'll fix it at some point.
      Great. Along those lines, it would be great to be able to make a popup menu, like the one for the VrayMaterial BRDF options:
      Code:
      int BRDF_type = 1
              [[ string widget = "popup",
              string options = "Phong|Blinn|Ward|GGX" ]],

      Comment


      • #18
        It's possible in 3ds Max, we just need to port it for Maya.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #19
          The popup and all the other widgets are in the ToDo.

          Slightly offtopic:
          Just keep in mind that the mapper widget would be the better option of the two (popup and mapper), because it deals with int attributes and not strings.
          Strings are generally slow types, so they should be avoided as much as possible.
          In OSL it is not that bad if they are constants, but you should keep this in mind.
          V-Ray developer

          Comment


          • #20
            Originally posted by t.petrov View Post
            The popup and all the other widgets are in the ToDo.

            Slightly offtopic:
            Just keep in mind that the mapper widget would be the better option of the two (popup and mapper)
            Good to know with the mapper, thanks!

            Are OSL pattern generation functions (Gabor, cellnoise, etc) on the toDo?

            Comment


            • #21
              Originally posted by sharktacos View Post
              Are OSL pattern generation functions (Gabor, cellnoise, etc) on the toDo?
              I think they are built-ins, we don't have to do anything about them. They should work right out of the box.

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment


              • #22
                Yes, they are implemented by the OSL project and they should work, but you have keep in mind that Gabor is known to be buggy up to OSL version of 1.6.1 (V-Ray uses 1.3.3).

                Quote from the OSL change log:
                * The "gabor" varieties of noise were found to have a serious mathematical
                bug, which after fixing results in a change to the pattern. We are hoping
                that they were rarely used, but beware a change in appearance. (1.6.1)
                Cellnoise should work fine, though.
                V-Ray developer

                Comment


                • #23
                  Vlado, I see you implemented the thin film shader on the docs page. That's awesome!

                  Comment


                  • #24
                    In the recent nightlies I've modified the translator and now it is possible to detect in a shader if a texture has a connection or not.
                    If you have access to the nightlies you can try it right away, if not it will be available in the next SP - 3.1.
                    V-Ray developer

                    Comment


                    • #25
                      Originally posted by t.petrov View Post
                      In the recent nightlies I've modified the translator and now it is possible to detect in a shader if a texture has a connection or not.
                      If you have access to the nightlies you can try it right away, if not it will be available in the next SP - 3.1.
                      Cool. What is the OSL code to call this functionality?

                      Comment


                      • #26
                        So I'm messing around with angle blends and seem to have re-created the different interpolation types of a Maya ramp in OSL (i.e. a ramp with the facing ratio of a sampler info connected to its V coord). Here's what I came up with:

                        Linear
                        float facingRatio = 1 - abs(dot(I, N));

                        Exponential up (not an exact match, but has less clipping, so actually nicer IMHO):
                        facingRatio = sqrt (facingRatio);

                        Exponential Down
                        facingRatio *= facingRatio;

                        Smooth:
                        facingRatio = smoothstep(0, 1, facingRatio);

                        I was wondering if anyone knows what the formula would be for the angle blends in the VrayVR Mat shader? (Normal Distribution, Sigmoid, Gompertz, Cube Root, Cubic, Cubic Polynominal) I get cubic and cubic root which I think would be

                        Cubic
                        facingRatio = pow(facingRatio, 3 );

                        Cubic root
                        facingRatio = pow(facingRatio, 0.33 );

                        Also I think Normal Distribution might be the same as a smoothstep (Hermite) above. Is that right?
                        But the others (Sigmoid, Gompertz, Polynomial) are making smoke come out of my ears
                        Last edited by sharktacos; 04-07-2015, 08:59 AM.

                        Comment


                        • #27
                          Originally posted by sharktacos View Post
                          Cool. What is the OSL code to call this functionality?
                          The same as in the cook_torrance.osl shader - calling gettextureinfo to get the number of channels.
                          Now it works as expected out of the box.
                          V-Ray developer

                          Comment


                          • #28
                            Our implementation of the Ramp texture is included in the [vraysdk]\samples\vray_plugins\textures\tex_Ramp.cpp file in the V-Ray SDK. However I don't think we've coded all the different types that Maya has. You should generally ask Autodesk about more info.

                            Best regards,
                            Vlado
                            I only act like I know everything, Rogers.

                            Comment


                            • #29
                              Originally posted by vlado View Post
                              Our implementation of the Ramp texture is included in the [vraysdk]\samples\vray_plugins\textures\tex_Ramp.cpp file in the V-Ray SDK. However I don't think we've coded all the different types that Maya has. You should generally ask Autodesk about more info.

                              Best regards,
                              Vlado
                              Thanks Vlado. I'm more interested in the interpolations used in the VrayVR Mat shader (Sigmoid, Gompertz, Polynomial, etc), rather than the Maya ones. Where would I find the code for that? is it also in the V-Ray SDK samples?

                              Comment


                              • #30
                                Originally posted by t.petrov View Post
                                The same as in the cook_torrance.osl shader - calling gettextureinfo to get the number of channels.
                                Now it works as expected out of the box.
                                Great, thanks.

                                Comment

                                Working...
                                X